<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var arr = [10, 15, 2, 32, 5, 4, 20, 8, 48, 54, 6]
    var arr1 = []
    arr.sort(function (a, b) {
        return b - a
    })

    for (let i = 0; i < 1; i) {
        if (arr[i] >= 10) {
            arr.shift(arr[i])
        } else {
            var arr2 = arr1.concat(arr)
            console.log(arr2)
            break;
        }
    }
</script>

</html>